
import java.util.Map;
import net.sshiffon.grittyish.*
import javax.swing.*
import net.sshiffon.*
import net.miginfocom.swing.MigLayout
import	java.awt.*
import	java.awt.event.*

import com.wittams.gritty.Style;
import com.wittams.gritty.swing.GrittyTerminal

class TermController {
    // these will be injected by Griffon
    def model
    def view

    def locController
    def remoteController


    void mvcGroupInit(Map<String,Object> args) {
    	view.terminalPanel.getStyleState().setCurrentForeground(new Color(new Integer(model.settings.foregroundcolor)))
    	view.terminalPanel.getStyleState().setCurrentBackground(new Color(new Integer(model.settings.backgroundcolor)))
    }
    
    boolean start()
	{
    	view.doOutside {
    		model.connector = new GrittyConnector ( model.session, model.savedName, 
    			terminalPanel)
    		model.connector.kick()
    	}
    	return true
	}
}